From: Umang Parmar Date: Wed, 17 May 2023 07:45:36 +0000 (+0100) Subject: Update log file directory. X-Git-Tag: archive/raspbian/29.0.6-28+rpi1^2~36 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b976f72c81a17eb2dea6b8e194e69a25b97dc351;p=android-platform-tools.git Update log file directory. Last Updated: 2018-05-17 Last Updated: 2018-05-17 Gbp-Pq: Topic system/core Gbp-Pq: Name move-log-file-to-proper-dir.patch --- diff --git a/system/core/adb/adb_utils.cpp b/system/core/adb/adb_utils.cpp index d1910f1c..9a9568c7 100644 --- a/system/core/adb/adb_utils.cpp +++ b/system/core/adb/adb_utils.cpp @@ -343,6 +343,11 @@ std::string GetLogFilePath() { return temp_path_utf8 + log_name; #else + std::string log_dir = android::base::StringPrintf("/run/user/%u/adb.log", getuid()); + struct stat st = {0}; + if (stat(log_dir.c_str(), &st) == 0) { + return log_dir; + } const char* tmp_dir = getenv("TMPDIR"); if (tmp_dir == nullptr) tmp_dir = "/tmp"; return android::base::StringPrintf("%s/adb.%u.log", tmp_dir, getuid());